<template>
  <lay-form :model="emailForm" :rules="rules" class="loginForm">
    <lay-form-item prop="user_no" mode="inline">
      <lay-input placeholder="请输入公司工号" v-model="emailForm.user_no" style="width: 380px">
        <template #prepend><lay-icon type="layui-icon-user"></lay-icon></template>
      </lay-input>
    </lay-form-item>
    <lay-form-item prop="email" mode="inline">
      <lay-input placeholder="请输入注册所填的邮箱账号" v-model="emailForm.email" style="width: 380px">
        <template #prepend><lay-icon type="layui-icon-email"></lay-icon></template>
      </lay-input>
    </lay-form-item>
    <lay-form-item>
      <lay-button type="normal" :fluid="true" @click="emailSubmit" style="width: 380px">找回密码</lay-button>
    </lay-form-item>
    <lay-line id="error_message">{{error_message}}</lay-line>
  </lay-form>
</template>

<script lang="ts">
export default {
    name: "fundPwd"
}
</script>

<script lang="ts" setup>
import {reactive,ref} from "vue";
import {layer} from "@layui/layer-vue";
import {useRouter} from "vue-router";

const error_message = ref("");
const rules = ref({
  email : {
    type :  'email'
  },
  user_no: {
      type: 'string',
      min: 4,
      max: 20
  }
})

const emailForm = reactive({user_no: '', email: ''})
const router = useRouter();

const emailSubmit = () => {
    layer.msg("待开发接口！请到邮箱查收密码！")
    router.push('/user/login');
}
</script>

<style scoped>

</style>